let nav = document.querySelector('.nav_right') //导航栏
let cont_nav = document.querySelector('.left>.title') //左边的内容
let block_nav = document.getElementsByClassName('block-nav')[0]
let uls = document.querySelector('.nav_left>ul')
let flag = true //标志量，判断导航栏是否点击
nav.flag = flag
nav.onclick = function () {
    if (nav.flag == true) {
        cont_nav.style.display = 'none'
        uls.style.opacity = 0
        block_nav.style.display = 'block'
        // console.log(nav.children[0]);
        nav.children[0].src = "./images/icon-close.svg"
        nav.children[0].style.width = "100%"
        nav.flag = false
    } else {
        cont_nav.style.display = 'block'
        uls.style.opacity = 1
        block_nav.style.display = 'none'
        nav.children[0].src = "./images/icon-hamburger.svg"
        nav.children[0].style.width = null
        nav.flag = true
    }
}